/* eslint-disable @typescript-eslint/no-unsafe-function-type */
/* eslint-disable @typescript-eslint/no-explicit-any */

import type { ApiResponse, TableQuery } from "@/types/basetypes"
import type { QueryWrapper } from "@/types/wrappertypes"

//表格列配置
export interface TableColumn {
  prop: string
  label: string
  width?: string | number
  formatter?: (row: any) => string
}

//分页配置
export interface PaginationParams {
  page: number
  page_size: number
}
export interface PaginationResponse<T> {
  items: T[]
  total: number
}


//业务dialog配置（组件入参）
export interface BusinessSelectorProps {
  title: string //标题
  selectIds : any , //勾选ids
  url: (params: QueryWrapper)=> Promise<ApiResponse<TableQuery<any>>> //查询api
  wrapper?:QueryWrapper, //查询条件
  columns: TableColumn[] //配置对应列
  isMultiple?: boolean //是否多选
  visible: boolean //是否显示
  pageSize?: number,
  rowKey?: string // 新增rowKey属性
}


//回调事件（组件事件，注意下这个。。。）
export interface SelectionEmits {
  (e: 'update:visible', value: boolean): void//显隐事件
  (e: 'selected', value: any | any[]): void//勾选事件
}
